<span class="msg" id="msgPrint">Náhled článku k tisku</span>
<span class="msg" id="msgExport">Export článku do PDF</span>
<span class="msg" id="msgEmail">Odeslání článku na emaily</span>

<script type='text/javascript' src='./js/swfobject.js'></script>
<script type="text/javascript" src="./js/tiny_mce/tiny_mce_gzip.js"></script>

<script type="text/javascript">
createTinyMCEOptimalization();
createForumWysiwyg("prispevek");
</script>
<?

echo "<div class='center'>";

if($user->getRole() >= ROLE_USER) {
	echo "<a class='button' href='#new_comment'>OKOMENTOVAT</a><br />";
}

echo "<div id='clanek'>";

$query = getReportAndPlayersCount($id_clanku);
$fetch = MySQL_Fetch_Array($query);
$datum = DateFormat::format($fetch["CAS_UPRAVY"], DF_DDMMYYYYHHMM);
$nadpis = $fetch["NADPIS"];
$popis = $fetch["POPIS"];
$text = $fetch["TEXT"];
$autor = $fetch["autor"];
$id_utkani = $fetch["id_utkani"];
$pocet_hracu = $fetch["pocet_hracu"];

echo "<div class='righted'>";
	echo "<a href='./print/clanek.php?id_clanku=".$id_clanku."' target='blank' onmouseover=\"MyTip('msgPrint', 'help')\" onmouseout='UnTip()'><img alt='Tisk' class='icon-btn' src='./img/icons/print.png' /></a>";
	echo "<a href='./print/export_pdf.php?id_clanku=".$id_clanku."' target='blank' onmouseover=\"MyTip('msgExport', 'help')\" onmouseout='UnTip()'><img alt='Export do PDF' class='icon-btn' src='./img/icons/file.png' /></a>";
	echo "<a onclick=\"popup_show('popup".$id_clanku."', 'popup_drag".$id_clanku."', 'popup_exit".$id_clanku."', 'screen-center',         0,   0);\" onmouseover=\"MyTip('msgEmail', 'help')\" onmouseout='UnTip()'><img alt='Poslat na email' class='icon-btn' src='./img/icons/email.png' /></a>";
echo "</div>";

echo "<div class='body'>";
echo "<div class='title'>$nadpis</div>";
echo "<div class='inner'>";
echo "<div class='date'>$datum</div>";
echo "<div class='content'>$popis</div>";
if($id_utkani != "" && $pocet_hracu >= 11) {
	echo "<div class='center roster'>";?>
<object class="centered"
	classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
	codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"
	width="500" height="350" id="swf/sestava" align="middle">
	<param name="allowScriptAccess" value="sameDomain" />
	<param name="movie"
		value="<? echo "./swf/sestava.swf?id_utkani=$id_utkani"; ?>" />
	<param name="quality" value="high" />
	<param name="bgcolor" value="#000000" />
	<param name="wmode" value="opaque" />
	<embed src="<? echo "./swf/sestava.swf?id_utkani=$id_utkani"; ?>"
		quality="high" wmode="opaque" bgcolor="#000000" width="500"
		height="350" name="swf/sestava" align="middle"
		allowScriptAccess="sameDomain" type="application/x-shockwave-flash"
		pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>
	<?
	echo "</div>";
}
echo "<div class='content'>$text</div>";
echo "<div class='author'>-".$autor."-</div>";
echo "</div>";

echo "<div class='righted' style='margin-top: 15px;'>";
	echo "<a href='./print/clanek.php?id_clanku=".$id_clanku."' target='blank' onmouseover=\"MyTip('msgPrint', 'help')\" onmouseout='UnTip()'><img alt='Tisk' class='icon-btn' src='./img/icons/print.png' /></a>";
	echo "<a href='./print/export_pdf.php?id_clanku=".$id_clanku."' target='blank' onmouseover=\"MyTip('msgExport', 'help')\" onmouseout='UnTip()'><img alt='Export do PDF' class='icon-btn' src='./img/icons/file.png' /></a>";
	echo "<a onclick=\"popup_show('popup".$id_clanku."', 'popup_drag".$id_clanku."', 'popup_exit".$id_clanku."', 'screen-center',         0,   0);\" onmouseover=\"MyTip('msgEmail', 'help')\" onmouseout='UnTip()'><img alt='Poslat na email' class='icon-btn' src='./img/icons/email.png' /></a>";
	echo "<br/><br/>";
	echo "<a name='fb_share' type='button_count' share_url='".get_url_of_page(PAGE_REPORT).add_par("id_clanku=$id_clanku")."' href='http://www.facebook.com/sharer.php'>Sdílet</a><script src='http://static.ak.fbcdn.net/connect.php/js/FB.Share' type='text/javascript'></script>";
echo "</div>";

echo "</div>";

echo "</div>";

echo "<a name='comments'></a>";

if($user->getRole() == ROLE_PUBLIC && getCountReportComments($id_clanku) == 0) {
} else {
	echo "<p class='center' style='font-size:14px;'><b>Komentáře k článku</b></p>";
}
echo "<div class='centered'>";
$query = getReportComments($id_clanku);
while($fetch = MySQL_Fetch_Array($query)){
	$id = $fetch["id"];
	$time = DateFormat::format($fetch["time"], DF_DDMMYYYYHHMM);
	$autor = $fetch["autor"];
	$text = $fetch["text"];
	echo "<a name='comment".$id."'></a>";
	echo "<div class='report-box px370' style='margin: 10px auto;'>";
	echo "<div class='header'><strong>$autor</strong> ($time) napsal</div>";
	echo "<div class='body'><div class='content'>$text</div></div>";
	echo "</div>";
}
echo "</div>";
echo "</div>";

$query = getReportVideos($id_clanku);
while($fetch = MySQL_Fetch_Array($query)){
	$id_video = $fetch["ID"];
	$soubor = $fetch["SOUBOR"];

	echo "<script type='text/javascript'>";
	echo "var s1 = new SWFObject('./swf/player.swf','player','400','300','9');";
	echo "s1.addParam('allowfullscreen','true');";
	echo "s1.addParam('allowscriptaccess','always');";
	echo "s1.addParam('flashvars','file=.".VIDEO_GALLERY_PATH.$soubor."');";
	echo "s1.write('video$id_video');";
	echo "</script>";
}

if($user->getRole() >= ROLE_USER) {
	$code = codegen();
?>

<a name='new_comment'></a>

<form name="formComment" action="<? echo redirect_str(PAGE_REPORT).add_par("id_clanku=".$id_clanku).action(ACTION_NEW_COMMENT); ?>"
	method="post"><input type="hidden" name="gen_code"
	value="<? echo $code; ?>" />

<fieldset><legend>Nový komentář</legend>
<table class="grid">
	<tr>
		<th>komentář <span class="star">*</span></th>
		<td><textarea class="px420 h100" id="prispevek" name='komentar_text'><? echo $komentar_text;?></textarea></td>
	</tr>

	<tr>
		<th></th>
		<td><img class="code" src="./inc/codegen.php?code=<?echo $code;?>"></td>
	</tr>

	<tr>
		<th>opište číslo z obrázku <span class="star">*</span></th>
		<td><input class='text required' type='text' maxlength="30"
			id='control_code' name='control_code' value=""></td>
	</tr>

</table>

<div class="center"><input type="submit" class="button"
	onmouseover="this.className='button_hover'"
	onmouseout="this.className='button'" value="VLOŽIT KOMENTÁŘ"></div>
</fieldset>
</form>
<?
}
require_once("./inc/email_modal.php");
?>